$(function () {
    let id = localStorage.getItem("typeId");
    findAll(id,"1");
});

function findAll(id,page) {
    let result = myAjax('/getPhoto', 'get', {id: id,page:page});
    let data = result.list;
    let pageCount = Math.ceil(result.number / 6);
    console.log(pageCount);
    let html = "";
    for (let i = 0; i < data.length; i++) {
        html+='<li onclick="roomDetails(' + data[i].roomId + ')">\n' +
            '  <img src="'+data[i].roomPhoto+'"/>\n' +
            '  <div>\n' +
            '  <p>'+data[i].roomTitle+'</p>\n' +
            '  <div>价格：'+data[i].roomPrice+'</div>\n' +
            '  </div>\n' +
            '  </li>';
    }
    aa(pageCount, page);
    $("#roomPhoto").html(html);
}

function roomDetails(id) {
  localStorage.setItem("temp",id);
  location.assign("/html/roomDetails.html")
}